/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.system.action.main;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.system.mapper.main.SystemSetupsMapper;
public class SystemSetups extends BaseAction
{
    @Autowired(required=false)
	private SystemSetupsMapper mapper;
    /**
    开发设置
    */
    
    public Map systemSetups() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_cfg=mapper.s_cfg(params);
        SQLMap s_cfg_emt=s_cfg.getExistfirst();
        result.put("s_cfg", s_cfg_emt);
        
        return result;
    }
    /**
    系统菜单设置
    */
    
    public Map systemMenu() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        tb = createTreeBean("s_menu_treecols");
        tb.setPrefix("img");
        tb.setOutlineNum("2");
        SQLList<SQLMap> s_menu=mapper.s_menu(params);
        s_menu = s_menu.buildTree(tb,tb.getPid());
        result.put("s_menu", s_menu);
        
        return result;
    }
    /**
    web菜单设置
    */
    
    public Map webSystemMenu() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        tb = createTreeBean("s_menu_treecols");
        tb.setPrefix("img");
        tb.setOutlineNum("2");
        SQLList<SQLMap> s_menu=mapper.s_menu(params);
        s_menu = s_menu.buildTree(tb,tb.getPid());
        result.put("s_menu", s_menu);
        
        return result;
    }
    /**
    */
    
    public Object l_menu() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        tb = createTreeBean("sys_menu_treecols");
        tb.setPrefix("img");
        tb.setOutlineNum("2");
        SQLList<SQLMap> sys_menu=mapper.sys_menu(params);
        sys_menu = sys_menu.buildTree(tb,tb.getPid());
        result.put("sys_menu", sys_menu);
        
        return sys_menu;
    }
    /**
    */
    
    public Object s_pmss() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        tb = createTreeBean("pmslist_treecols");
        tb.setPrefix("img");
        SQLList<SQLMap> pmslist=mapper.pmslist(params);
        pmslist = pmslist.buildTree(tb,tb.getPid());
        result.put("pmslist", pmslist);
        
        return pmslist;
    }
    /**
    开发设置修改
    */
    
    public Map systemSetupsSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.systemSetupsSubmit(params);
        
        
        SQLList<SQLMap> s_cfg=mapper.s_cfg(params);
        result.put("s_cfg", s_cfg);
        
        
        getSystemStatus().buildGlobalParams(s_cfg,context.getServletContext());
        
        return result;
    }
    /**
    web菜单设置修改
    */
    
    public Map webSystemMenuSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("")){
            params=new SQLParam(request,emt.getMap());
            mapper.webSystemMenuSubmit(params);
        }
        
        return result;
    }
    /**
    */
    
    public Map onloadsubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.onloadsubmit(params);
        
        return result;
    }
    /**
    系统菜单编辑修改
    */
    
    public Map systemMenuEditSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int d_menuauth = mapper.d_menuauth(params);
        result.put("d_menuauth", d_menuauth);
        
        
        for (SQLMap emt:hqlBean.getTableElements("pageArray")){
            params=new SQLParam(request,emt.getMap());
            mapper.i_menuauth(params);
        }
        
        return result;
    }
    /**
    */
    
    public Map update() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.update(params);
        
        return result;
    }
}